package org.java.mode;

public class Prime {
	public static boolean isPrime(int num) {
		for (int i = 2; i < num; i++) {// 运行效率不高
			if ((num % i) == 0) {
				return false;
			}
		}
		return true;
	}

	public static void main(String[] args) {
		int count = 5000;
		int[] x = new int[5000];
		int found = 0;
		long n = 1;
		long tagTime = System.currentTimeMillis();
		for (int i = 2; found < count; i++) {
			if (isPrime(i)) {
				x[found] = i;
				found++;
				System.out.println("i:" + i + "...." + found);
				n = n*i;
			}
		}

		System.out.println(n);
		// for (int i = 1; i <= 5000; i += 2) {
		// if (isPrime(i)) {
		// System.out.print(i + " ");
		// }
		// }
		System.out.println();
		System.out.println(System.currentTimeMillis() - tagTime);
	}
}